import type * as T from './type'
import http from '@/utils/http'
import type { LabelValueState } from '@/types/global'

export type * from './type'

/**
 * 查询参数列表
 * @param query
 */
export function listOption(query: T.OptionQuery) {
  return http.get<T.OptionResp[]>(`/system/option`, query)
}

/**
 * 修改参数
 * @param data
 */
export function updateOption(data: any) {
  return http.put(`/system/option`, data)
}

/**
 * 重置参数
 * @param query
 */
export function resetOptionValue(query: T.OptionQuery) {
  return http.patch(`/system/option/value`, query)
}

/**
 * 查询系统配置参数
 */
export function listSiteOptionDict() {
  return http.get<LabelValueState[]>(`/system/option/dict/site`)
}
